package com.cgy.utils.jmx.jvm.jvm;

import com.cgy.utils.jmx.IJvmInfoFactory;

import java.util.HashMap;
import java.util.Map;

/**
 * @author CHTK
 */
public class JvmFactory extends IJvmInfoFactory {

    @Override
    public void status() {
        Map<String, String> fields = fields();
        for (Map.Entry<String, String> stringStringEntry : fields.entrySet()) {
            put(stringStringEntry.getKey(), System.getProperty(stringStringEntry.getKey()), stringStringEntry.getValue());
        }
    }

    @Override
    public Map<String, String> fields() {
        return new HashMap<String, String>() {
            {
                put("java.version", "Java运行时环境版本");
                put("java.vendor", "Java 运行时环境供应商:");
                put("java.home", "Java安装目录");
                put("java.io.tmpdir", "默认的临时文件路径");
                put("java.compiler", "要使用的 JIT 编译器的名称:");
            }
        };
    }

}
